package com.ruoyi.common.enums;

/**
 * 用户状态
 * 
 * @author ruoyi
 */
public enum UserType
{
    ADMIN("00", "超级管理员"),
    ADMINISTRATORS("01", "系统管理员"),
    LEADER("02", "班组长"),
    COMMON("03", "组员"),
    OTHER("04", "其他");

    private final String code;
    private final String info;

    UserType(String code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public String getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }

    public String getCodeByInfo(String info)
    {
        if(info.equals(ADMIN.getInfo())) return ADMIN.getCode();
        if(info.equals(ADMINISTRATORS.getInfo())) return ADMINISTRATORS.getCode();
        if(info.equals(LEADER.getInfo())) return LEADER.getCode();
        if(info.equals(COMMON.getInfo())) return COMMON.getCode();
        return OTHER.getCode();
    }
}
